x86/mm: Implement common put_data_pages for put_page_from_l[23]e
authorGeorge Dunlap <george.dunlap@citrix.com>
Fri, 13 Dec 2019 12:53:04 +0000 (12:53 +0000)
committerGeorge Dunlap <george.dunlap@citrix.com>
Fri, 13 Dec 2019 17:15:52 +0000 (17:15 +0000)
commitc9115affa6f83aebe29ae9cbf503aa163911a5bb
treeb614ba7579d24814931f90cc4e91517dbc670ebc
parentcca2eac887c64f69b3a7662e2cc6911db097c846
x86/mm: Implement common put_data_pages for put_page_from_l[23]e

Both put_page_from_l2e and put_page_from_l3e handle having superpage
entries by looping over each page and "put"-ing each one individually.
As with putting page table entries, this code is functionally
identical, but for some reason different.  Moreover, there is already
a common function, put_data_page(), to handle automatically swapping
between put_page() (for read-only pages) or put_page_and_type() (for
read-write pages).

Replace this with put_data_pages() (plural), which does the entire
loop, as well as the put_page / put_page_and_type switch.

Signed-off-by: George Dunlap <george.dunlap@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/mm.c